package com.vnaloha.util;

import java.util.Random;

public class StringUtil {
	private static String base = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabsdefghijklmnopqrstuvwxyz";
	private static Random random = new Random();
	
	/**
	 * Create radom string by base number and character
	 * @param length
	 * @return a random string
	 */
	public static String randomString(int length) {
		StringBuilder b = new StringBuilder();
		for (int i = 0; i < length; i++) {
			b.append(base.charAt(random.nextInt(base.length())));
		}
		return b.toString();
	}
}
